package ClassesFieldsMethods;

public class Car 
{

	String model;
	int maxSpeed;
	int currentSpeed;
	String color;
	int currentGear;
	
	Person owner;
	Person owner2;
	//Person owner3 = new Person(); - tova e greshno po princip, zashtoto tova znachi, che chrez obekta Person shte sazdavame vseki pat nov vodach na kolata
	//a moje da iskame niakolko obekta ot tip Car da imat edin sobstvenik, ili izobshto da niama nikakav sobstvenik
	//Vseki pat kato sazdavame nashata kola VINAGI s nov sobstvenik
	
	
	void accelerate()
	{
		currentSpeed += 10;
		if(currentSpeed > maxSpeed)
		{
			maxSpeed = currentSpeed;
		}
	}
	
	void changeGearUp() 
	{ 
		if(currentGear == 5)
		{
			System.out.println("No more gears to turn up!");
		}
		else
		{
		currentGear++;
		}

	}
	void changeGearDown()
	{
		currentGear--;
	}
	void changeGear(int gear)
	{
		if(gear > 0 && gear > 6)
		{
			currentGear = gear;
			System.out.println("No such gear!");
		}
	}
	void changeColor(String newColor)
	{
		color = newColor;
	}
}
